import {BrowserRouter as Router, Switch, Route} from "react-router-dom"
import Home from "../pages/Home"
import User from "../pages/User"
import Fast from "../pages/Fast"
import Error from "../pages/Error"
import Login from "../pages/Login"
import App from "../App"

const router = () => (
  <Router>
    <Switch>
      <Route path="/" component={() => (
        <App>
          <Switch>
          <Route exact path="/home" component={Home}></Route>
          <Route exact path="/fast" component={Fast}></Route>
          <Route exact path="/user" component={User}></Route>
          <Route exact path="/login" component={Login}></Route>
          <Route exact path="*" component={Error}></Route>
          </Switch>
        </App>
      )}></Route>
      
    </Switch>
  </Router>
)

export default router